﻿<UserControl x:Class="BallOnTiltablePlate.JanRapp.MainApp.GlobalSettingsUI"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:BallOnTiltablePlate.JanRapp.Controls"
        xmlns:controls="clr-namespace:JRapp.WPF;assembly=JRapp.WPF"
        xmlns:ballOnTiltablePlate="clr-namespace:BallOnTiltablePlate"
        Width="393"
        Height="416">
    <StackPanel>
        <Border>
            <controls:SettingsSaver x:Name="GlobalSettingsSS" Height="140">
                <StackPanel Orientation="Vertical" Height="101">
                    <controls:DoubleBox 
                        x:Name="HalfPlateSize"
                        Height="24"
                        Margin="8,0"
                        Text="Half Width and Length of the _Plate (in Meters): "
                        Minimum=".01"
                        LargeChange=".5"
                        RegularChange=".1"
                        SmallChange=".01"
                        Value="{Binding HalfPlateSize, Mode=TwoWay, Source={x:Static ballOnTiltablePlate:GlobalSettings.Instance}}"
                      />
                    <controls:DoubleBox
                        x:Name="JugglerUpdatesPerSecound"
                        Text="Set _Updates per Second for Juggeler: "
                        Margin="8,0"
                        Minimum=".0001"
                        LargeChange="10"
                        RegularChange="2"
                        SmallChange=".1"
                        Value="{Binding FPSOfAlgorithm, Mode=TwoWay, Source={x:Static ballOnTiltablePlate:GlobalSettings.Instance}}"
                      />
                    <controls:DoubleBox
                        x:Name="MaximumTilt"
                        Text="_Maximum Tilt the Plate may has to an Axis: "
                        Margin="8,0"
                        Minimum=".0001"
                        SmallChange="0.02454369260617025967548940143187" RegularChange="0.04908738521234051935097880286374" LargeChange="0.09817477042468103870195760572748"
                        Value="{Binding MaxTilt, Mode=TwoWay, Source={x:Static ballOnTiltablePlate:GlobalSettings.Instance}}"
                      />
                    <controls:DoubleBox
                        x:Name="UpdateTime"
                        Text="_Time that is passed between two updates of a component: "
                        Margin="8,0"
                        SmallChange="0.001" RegularChange="0.01" LargeChange="0.1"
                        Value="{Binding UpdateTime, Mode=TwoWay, Source={x:Static ballOnTiltablePlate:GlobalSettings.Instance}}"
                      />
                </StackPanel>
            </controls:SettingsSaver>
        </Border>
        <GroupBox Header="Enviroment Varialbles" Margin="8">
            <StackPanel>
                <TextBlock TextWrapping="Wrap">If you chagne the Enviromentvariable somewhere else but here, the loaded SettingsSaver don't get the new save location assigned and the application needs to be restarted.</TextBlock>
                <StackPanel Orientation="Horizontal">
                    <Label Content="%b3SettingsSaver_SaveLocation%: " Target="{Binding ElementName=SettingsSaverSaveLocation}" Margin="8,0" VerticalAlignment="Bottom" Height="26"/>
                    <Button Content="_Browse" HorizontalAlignment="Right" Margin="8,8,8,2" Width="75" Click="BrowseSaveLocation_Click"/>
                </StackPanel>
                <TextBox x:Name="SettingsSaverSaveLocation" Margin="8,0"/>
                <StackPanel Orientation="Horizontal">
                    <Label Content="%b3SettingsSaver_BackupLocation%: " Target="{Binding ElementName=SettingsSaverBackupLocation}" Margin="8,0" VerticalAlignment="Bottom" Height="26"/>
                    <Button Content="_Browse" HorizontalAlignment="Right" Margin="8,8,8,2" Width="75" Click="BrowseBackupLocation_Click"/>
                </StackPanel>
                <TextBox x:Name="SettingsSaverBackupLocation" Margin="8,0"/>
                <Button Content="Set _Envirmoment Variables" Width="170" Margin="8" HorizontalAlignment="Right" Click="SetEnviromentVariables_Click"/>
            </StackPanel>
        </GroupBox>
        <StackPanel Orientation="Horizontal">
            <controls:DoubleBox x:Name="PhysicalKinectAngle"
                        Text="_Angle of Kinect [-40, 40]: "
                        Margin="8,2"
                        Minimum="-27"
                        Maximum="27" 
                        LargeChange="5"
                        RegularChange="2"
                        SmallChange="1"
                          />
            <Button x:Name="SetPhysicalKinectAngle"
                        Content="Se_t Angle"
                        Click="SetPhysicalKinectAngle_Click" 
                        Margin="8,2" 
                        Height="25" 
                    />
        </StackPanel>
    </StackPanel>
</UserControl>
